package com.mapper;


import com.domain.entity.BusinessCount;
import com.domain.entity.AllName;
import com.project.domain.entity.SyntProject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface HomePageMapper {

    /**
     * 获取业务表信息
     * @param map
     * @return
     */
    AllName getBusinessByProCig(Map<String,String> map);

    /**
     * 根据项目库id获取项目
     * @param projectId
     * @return
     */
    SyntProject getProjectByProjectId(@Param("projectId") String projectId);

    /**
     * 根据成果库id获取项目
     * @param achieveId
     * @return
     */
    String getAchieveByAchieveId(@Param("achieveId") String achieveId);



    @Select("select PROJECT_CLASS from v_project  where id =#{id}")
    String getProjectTypeFromView(@Param("id") String id);

    @Select("SELECT large_module_show FROM `process_config`  GROUP BY large_module_show")
    List<String>  getLargeModules();
    /**
     * 获取经费的项目id
     * @param map
     * @return
     */
    String getProjectId(Map<String,String> map);


    List<BusinessCount> feeAuthorizeCount();


    List<BusinessCount> incomeFeeCount(@Param("unitIds") List<String> unitIds);


    List<Map<String,Integer>> projectNumCount(@Param("userId")String userId,@Param("unitIdList")List<String> unitIdList);


    List<Map<String,String>> achievementNumCount(@Param("userId")String userId);



    /**
     * 用户待办列表
     * @return
     */
    List<AllName> getTodoList(AllName all);

    /**
     * 获取用户的待办列表的数量
     * @return
     */
    List<Map<String,String>> getTodoNum(@Param("userId") String userId,@Param("moduleList")List<String> moduleList);

    List<AllName> getDoneList(AllName all);

    /**
     * 获取用户的已办列表的数量
     * @return
     */
    List<Map<String,String>> getDoneNum(@Param("userId") String userId,@Param("moduleList")List<String> moduleList);

    List<AllName> myProcess_sql(AllName all);


}
